//
//  UIButton+extesion.m
//  王雷Sinoweibo
//
//  Created by wanglei on 16/10/30.
//  Copyright © 2016年 wanglei. All rights reserved.
//

#import "UIButton+extesion.h"

@implementation UIButton_extesion


+(UIButton *)factoryLabel:(NSString *)title titleColor:(UIColor *)titleColor imageName:(NSString *)imageName;{
    
        UIButton *button = [[UIButton alloc]init];
        [button setTitle:title forState:UIControlStateNormal];
        [button setTitleColor:titleColor forState:UIControlStateNormal];
        [button setBackgroundImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];

    return button;
    
}


-(id)initWithTitle:(NSString *)title titleColor:(UIColor *)titleColor imageName:(NSString *)imageName;{
    
    self = [super init];
    if (self) {
        
//        UIButton *button = [[UIButton alloc]init];
        [self setTitle:title forState:UIControlStateNormal];
        [self setTitleColor:titleColor forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];

    }
    
    return self;
}
@end
